<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>商城登录页</title>
    <link rel="stylesheet" href="../static/css/login.css" th:href="@{/css/login.css}">
    <link href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <script>
        function refreshCode() {
            let vcode = document.getElementById("vcode");
            vcode.src = "http://localhost:8081/checkCode?time" + new Date().getTime();
        }
    </script>
</head>
<body>
<div>
    <div class="login-div">
        <h1>淘淘商城登录</h1>
        <form id="login-form" th:action="@{/user/login}" method="post">
            <div class="login-form-item">
                <input name="username" placeholder="用户名">
            </div>
            <div class="login-form-item">
                <input name="password" type="password" placeholder="密码">
            </div>
            <div class="login-form-item">
                <input name="code" placeholder="验证码" id="code">
                <a href="javascript:refreshCode()"><img th:src="@{/checkCode}" id="vcode"></a>
            </div>
            <button class="btn-login" type="submit">登录</button>
        </form>
        <div class="form_bottom">
            <a th:href="@{/register}">免费注册</a>
        </div>
    </div>
    <div class="alert alert-warning alert-dismissible" role="alert" style="margin-top: 10px"
         th:unless="${#strings.isEmpty(msg)}">
        <button type="button" class="close" data-dismiss="alert" aria-label="Close">
            <span aria-hidden="true">&times;</span></button>
        <strong th:text="${msg}"></strong>
    </div>
</div>
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script type="text/javascript" th:src="@{/js/bootstrap.min.js}"></script>
</body>
</html>